import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:flutter/material.dart';

class SubPaymentItem extends StatelessWidget {
  final EdgeInsets padding;
  final List<Widget> children;

  SubPaymentItem({
    Key key,
    this.padding = const EdgeInsets.only(
      left: 25,
      right: 28,
    ),
    this.children,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: padding,
      child: PressedOpacityButton(
          padding:
              EdgeInsets.symmetric(horizontal: getDp(26), vertical: getDp(12)),
          color: Colors.white,
          borderRadius: BorderRadius.circular(getDp(10)),
          boxShadow: [
            BoxShadow(
              offset: Offset(0.0, getDp(4)),
              blurRadius: getDp(22),
              spreadRadius: -getDp(4),
              color: Colors.black.withOpacity(0.25),
            ),
          ],
          onPressed: () {},
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: children,
          )),
    );
  }
}

class SpaceBetweenItem extends StatelessWidget {
  final String title;
  final String value;
  const SpaceBetweenItem({Key key, this.title, this.value}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text(title),
        AppSpaces.h25,
        Text(
          value,
          style: TextStyle(fontWeight: FontWeight.bold),
        ),
      ],
    );
  }
}
